//-----------------------------------------------------------------------------
// Bend2D - Physics Engine
// Roberto Bender <beto.bender@gmail.com>
// Description: 
// Date: 23/03/2010
//-----------------------------------------------------------------------------
#include "objectcreator.h"
#include "gravity.h"
#include "boundary.h"
using namespace bend2d;

Boundary* ObjectCreator::CreateBoundary() const 
{ 
    return new Boundary(); 
}

Boundary* ObjectCreator::CreateBoundary(const Line& line) 
{ 
    return new Boundary(line); 
}

Boundary* ObjectCreator::CreateWorldBoundary() const 
{ 
    return new Boundary(); 
}

WindPoint* ObjectCreator::CreateWindPoint() const 
{ 
    return NULL; 
}

WindPoint* ObjectCreator::CreateWindPoint(const Point& position, const Speed& speed, const Acceleration& acceleration) 
{ 
    return NULL; 
}

PhysicForce* ObjectCreator::CreatePhysicForce(const string& name)
{
    if(name == "Gravity")
        return new Gravity();
    return NULL;
}

list<FastCast*> ObjectCreator::CreateBoundaryBox(const Rectangle& box)
{
    list<FastCast*> ret;
    ret.push_back(CreateBoundary(box.GetTopLine()));
    ret.push_back(CreateBoundary(box.GetRightLine()));
    ret.push_back(CreateBoundary(box.GetLeftLine()));
    ret.push_back(CreateBoundary(box.GetBottomLine()));
    return ret;
}

Collision* ObjectCreator::AccessCollisionHandler()
{
    return &m_CollisionHandler;
}
